package org.smile.homework01.kevin.Rocket;




public class Engine {

         int runtime;
         int cdtime;
         int cooltime;
         int engineNum;
         String engineName;

         String status;

         public Engine(int Num){
             this.engineName = engineName;
           engineNum = Num;
           engineName = "Engine" + Num;

           cdtime = (int)(Math.random()*10);
           runtime = (int)(Math.random()*10+1);

           status = "standby";
         }

         public String getEngineName(){return engineName;}


         public String getStatus(){
             return status;
         }
         public void setCooltime(int x){cooltime = x;}
    public int getRuntime(){return runtime;}
    public int getCdtime(){return cdtime;}

    public void CoolDown() {
        if (cooltime == 0) {
            status = "standby";
        }
        if (status.equals("cooling")) {
            cooltime--;
            System.out.println(engineName + "冷却时间剩余" + cooltime );
        }
    }



}







